package cn.edu.cqut.mapper;

import cn.edu.cqut.entity.Record;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cqut-917371
 * @since 2020-06-24
 */
public interface RecordMapper extends BaseMapper<Record> {
	@Select("select * from record where cus_no=#{cusNo}")
	List<Record> selectRecordByCusNo(Integer cusNo);
	
	//${ew.customSqlSegment} 是固定的
	@Select("SELECT record.*,customer.cus_name from record,customer ${ew.customSqlSegment} ")
	//@Param(Constants.WRAPPER)条件查询
	Page<Record> selectRecordWithCustomer(Page<Record> page, @Param(Constants.WRAPPER) QueryWrapper<Record> qw);
		
}
